<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">


  <bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
    <property name="driverClass" value="org.h2.Driver"/>
    <property name="url" value="jdbc:h2:mem:camunda_ProcessInstanceModificationInTransactionTest;DB_CLOSE_DELAY=1000;TRACE_LEVEL_FILE=0;DB_CLOSE_ON_EXIT=FALSE"/>
    <property name="username" value="sa"/>
    <property name="password" value=""/>
  </bean>

  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource"/>
  </bean>

  <!-- bind the process engine service as Spring Bean -->
  <bean name="processEngineService" class="org.camunda.bpm.BpmPlatform" factory-method="getProcessEngineService"/>

  <bean id="processEngineConfiguration"
        class="org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource"/>
    <property name="transactionManager" ref="transactionManager"/>
    <property name="databaseSchemaUpdate" value="true"/>
    <property name="jobExecutorActivate" value="false"/>

    <property name="history" value="full"/>
    <property name="telemetryReporterActivate" value="false" />

  </bean>

  <bean id="processEngineRule" class="org.camunda.bpm.engine.test.ProcessEngineRule">
    <property name="processEngine" ref="processEngine"/>
  </bean>


  <!-- bind the default process engine as Spring Bean -->
  <bean id="processEngine"
        class="org.camunda.bpm.engine.spring.ProcessEngineFactoryBean">
    <property name="processEngineConfiguration" ref="processEngineConfiguration"/>
  </bean>

  <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/>
  <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/>
  <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
  <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
  <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/>

  <context:annotation-config/>


  <bean id="userBean" class="org.camunda.bpm.engine.spring.test.transaction.modification.UserBean"></bean>
  <bean id="deleteVariableListener" class="org.camunda.bpm.engine.spring.test.transaction.modification.DeleteVariableListener"></bean>
  <bean id="calculateTimerDate" class="org.camunda.bpm.engine.spring.test.transaction.modification.CalculateTimerDate"></bean>

  <tx:annotation-driven transaction-manager="transactionManager"/>

</beans>
